﻿@model IEnumerable<WebshopHPWcore.Models.ApplicationUser>
@{
    ViewData["Title"] = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>Beheer gebruikers</h2>
<p>
    <a asp-action="Create">Nieuwe gebruiker toevoegen</a>
</p>

@await Html.PartialAsync("PaginationView")

<table class="table">
    <thead>
        <tr>
            <th>
                Gebruikersnaam
            </th>
            <th>
                Name
            </th>
            <th>
                Email
            </th>
            <th>
                Telefoonnummer
            </th>
            <th>
                Woonplaats
            </th>
            <th>
                Adres
            </th>
            <th>
                Postcode
            </th>
            <th>
                Rollen
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.UserName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.FirstName) @Html.DisplayFor(modelItem => item.MiddleName) @Html.DisplayFor(modelItem => item.lastName)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Email)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PhoneNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.City)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Address) @Html.DisplayFor(modelItem => item.HouseNumber)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ZipCode)
                </td>
                <td>
                    @*@Html.Raw(ViewData["userroles"])*@
                </td>
                <td>
                    <a asp-action="Edit" asp-route-id="@item.Id">Aanpassen</a> |
                    @*<a asp-action="Details" asp-route-id="@item.Id">Details</a> |*@
                    <a asp-action="Delete" asp-route-id="@item.Id">Verwijderen</a>
                </td>
            </tr>
        }
    </tbody>
</table>

@await Html.PartialAsync("PaginationView")